<script setup lang="ts">
import { ref, toRefs } from "vue";
const props = defineProps({
  title: String,
});
const emit = defineEmits(["handleOk"]);
const { title } = toRefs(props);
const open = ref<boolean>(false);
const openModal = () => {
  open.value = true;
};
const closeModal = () => {
  open.value = false;
};
const handleOk = () => {
  emit("handleOk");
};
defineExpose({ openModal, closeModal });
</script>

<template>
  <a-modal
    v-model:open="open"
    :title="title"
    @ok="handleOk"
    @cancel="closeModal"
    v-bind="$attrs"
  >
    <div style="margin-top: 20px">
      <slot></slot>
    </div>
  </a-modal>
</template>
